package com.firefly.dao.assembler.cms;

import com.firefly.dao.dao.cms.po.ArticlePo;
import com.firefly.dao.dto.cms.ArticleDto;
import com.firefly.dao.vo.cms.ArticleVo;
import org.springframework.stereotype.Component;

/**
 * @description: 文章
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/12/20
 **/
@Component
public class ArticleAssembler {
    public ArticleVo getVo(ArticlePo entity){
        ArticleVo detail = new ArticleVo();
        detail.setId(entity.getId());
        detail.setCateId(entity.getCateId());
        detail.setTitle(entity.getTitle());
        detail.setKeywords(entity.getKeywords());
        detail.setThumb(entity.getThumb());
        detail.setDescription(entity.getDescription());
        detail.setContent(entity.getContent());
        detail.setTpl(entity.getTpl());
        detail.setPushFlag(entity.getPushFlag());
        detail.setSource(entity.getSource());
        detail.setLinkFlag(entity.getLinkFlag());
        detail.setUrl(entity.getUrl());
        detail.setSort(entity.getSort());
        detail.setHits(entity.getHits());
        detail.setPublishAt(entity.getPublishAt());
        return detail;
    }
    public ArticlePo getPo(ArticleDto detail){
        ArticlePo entity = new ArticlePo();
        entity.setId(detail.getId());
        entity.setCateId(detail.getCateId());
        entity.setTitle(detail.getTitle());
        entity.setKeywords(detail.getKeywords());
        entity.setThumb(detail.getThumb());
        entity.setDescription(detail.getDescription());
        entity.setContent(detail.getContent());
        entity.setTpl(detail.getTpl());
        entity.setPushFlag(detail.getPushFlag());
        entity.setSource(detail.getSource());
        entity.setLinkFlag(detail.getLinkFlag());
        entity.setUrl(detail.getUrl());
        entity.setSort(detail.getSort());
        entity.setHits(detail.getHits());
        entity.setPublishAt(detail.getPublishAt());
        return entity;
    }
}
